<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.tss.util.*"%>
<%@page import="com.jedi.*"%>
<%@page import="com.store.*"%>
<%@page import="com.store.ContractMgr"%>
<%@page import="com.store.Contract"%>
<%@page import="java.util.*"%>
<%@include file="../global_var.jsp"%>
<%@include file="../check_login.jsp"%>
<%
int pageno=Integer.parseInt((String)(session.getAttribute("pageno")));//页码
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
ContractMgr contractMgr = new ContractMgr();
String conid = ParamUtils.getParameter(request,"conid","");
String cmd = ParamUtils.getParameter(request,"cmd","");
Contract contract = contractMgr.get(conid) ;
User just_user = (User)session.getAttribute("LoginUser");
String power_enable_id = "10103";
String power1_enable_id = "10107";
if (!just_user.hasPower(power1_enable_id)) {
		if(!just_user.hasPower(power_enable_id)){ 
				out.println(strNoPowerInfo); 
			     return;  
	     }else if(!just_user.getId().trim().equals(contract.getCreateman())){
	     out.println(strNoPowerInfo); 
			     return;  
	     }
}
String strErr = "";
String  serviceid         = ParamUtils.getParameter(request,"serviceid","");
 String     area           = ParamUtils.getParameter(request,"area","");
 String   customer         = ParamUtils.getParameter(request,"customer","");
String    linkman          = ParamUtils.getParameter(request,"linkman","");
 String   phone            = ParamUtils.getParameter(request,"phone","");
String    saleid           = ParamUtils.getParameter(request,"saleid","0");
int     busid           = ParamUtils.getIntParameter(request,"busid",0);
String   salesname        = ParamUtils.getParameter(request,"salesname","");
String   prjname        = ParamUtils.getParameter(request,"prjname","");
 String   begindate        = ParamUtils.getParameter(request,"begindate",TSSDate.shortDate());
 String   enddate          = ParamUtils.getParameter(request,"enddate",TSSDate.shortDate());
int   servicelevel      =Integer.parseInt( ParamUtils.getParameter(request,"servicelevel","0"));
String    contractdesc     = ParamUtils.getParameter(request,"contractdesc","");
 String   contractfile     = ParamUtils.getParameter(request,"contractfile","");
  String  fifee       = ParamUtils.getParameter(request,"fifee","0.00");
String   mfee    = ParamUtils.getParameter(request,"mfee","0.00");
 String   myear     = ParamUtils.getParameter(request,"myear","0");
 String   spartfee  = ParamUtils.getParameter(request,"spartfee","0.00");
 String   outefee    = ParamUtils.getParameter(request,"outefee","0.00");
 String      signfee    = ParamUtils.getParameter(request,"signfee","0.00");
 String   techbegindate    = ParamUtils.getParameter(request,"techbegindate",TSSDate.shortDate());
 String   techenddate      = ParamUtils.getParameter(request,"techenddate",TSSDate.shortDate());
 String   sevbegindate     = ParamUtils.getParameter(request,"sevbegindate",TSSDate.shortDate());
 String   sevenddate       = ParamUtils.getParameter(request,"sevenddate",TSSDate.shortDate());
  
String   analyreport          = ParamUtils.getParameter(request,"analyreport","");
String  techsupport        = ParamUtils.getParameter(request,"techsupport","");
 int  status        = ParamUtils.getIntParameter(request,"status",1);
 int  comid          = ParamUtils.getIntParameter(request,"comid",0);
 String techmanager        = ParamUtils.getParameter(request,"techmanager","0");
String  assigntime          = ParamUtils.getParameter(request,"assigntime",TSSDate.shortDate());

 String  create_man         = ParamUtils.getParameter(request,"create_man","");
if (contract == null || contract.getId().trim().equals("")) strErr = "此合同信息不存在!";
List list = null;
//合同修改
if (cmd.trim().equals("modify") && strErr.trim().equals("")) {

	if (strErr.trim().equals("") && area.trim().equals("")) {
		strErr = "请选择区域!";
	}
	if (strErr.trim().equals("") && prjname.trim().equals("")) {
		strErr = "请输入项目名称!";
	}
		if (strErr.trim().equals("") && customer.trim().equals("")) {
		strErr = "请输入客户名称!";
	}
	if (strErr.trim().equals("") && conid.trim().equals("")) {
		strErr = "合同编号不能为空!";
	}

	

	if (strErr.trim().equals("") && techmanager.trim().equals("0")) {
		strErr = "请选择项目经理!";
	}
	
	
	
	if (strErr.trim().equals("") && contractdesc.length() >= 500) {
		strErr = "合同描述信息在500字以内!";
	}
	if (strErr.trim().equals("")) {
		try {
			Float.parseFloat(fifee);
		}
		catch(Exception ex) {
			strErr = "初次安装费金额数值输入错误!";
		}
	}
	if (strErr.trim().equals("")) {
		try {
			Float.parseFloat(mfee);
		}
		catch(Exception ex) {
			strErr = "现场维护金额数值输入错误!";
		}
	}
	if (strErr.trim().equals("")) {
		try {
			Integer.parseInt(myear);
		}
		catch(Exception ex) {
			strErr = "维护年限应为整型!";
		}
	}
	
	if (strErr.trim().equals("")) {
		try {
			Float.parseFloat(spartfee);
		}
		catch(Exception ex) {
			strErr = "备件成本数值输入错误!";
		}
	}
	if (strErr.trim().equals("")) {
		try {
			Float.parseFloat(outefee);
		}
		catch(Exception ex) {
			strErr = "外部人员技术成本金额数值输入错误!";
		}
	}
	if (strErr.trim().equals("")) {
		try {
			Float.parseFloat(signfee);
		}
		catch(Exception ex) {
			strErr = "签约金额数值输入错误!";
		}
	}
	

	if (strErr.trim().equals("")) {
	FormatDate formatDate = new FormatDate();
		contract.setArea(area);
		contract.setId(conid);
		contract.setBegindate(formatDate.toDate(begindate));
		contract.setContractdesc(contractdesc);
		contract.setContractlile(contractfile);
		contract.setCustomer(customer);
		contract.setEnddate(formatDate.toDate(enddate));
		contract.setLinkman(linkman);
		contract.setPhone(phone);
		contract.setSaleid(saleid);
		contract.setServiceid(serviceid);
		contract.setSevbegindate(formatDate.toDate(sevbegindate));
		contract.setSevenddate(formatDate.toDate(sevenddate));
		contract.setFifee(Double.parseDouble(fifee));
		contract.setMfee(Double.parseDouble(mfee));
		contract.setMyear(Integer.parseInt( myear));
		contract.setSpartfee(Double.parseDouble(spartfee));
		contract.setOutefee(Double.parseDouble(outefee));
			contract.setSignfee(Double.parseDouble(signfee));
		contract.setServicelevel(servicelevel);
		contract.setTechbegindate(formatDate.toDate(techbegindate));
		contract.setTechenddate(formatDate.toDate(techenddate));
		contract.setAnalyreport(analyreport);
		contract.setTechsupport(techsupport);
		contract.setComid(comid);
		contract.setBusid(busid);
		contract.setStatus(status);
		contract.setTechmanager(techmanager);
		contract.setAssigntime(formatDate.toDate(assigntime));
		contract.setPrjname(prjname);
		//contract.setContype(1);
	contract.update();
	if (contract.hasErr()) strErr = contract.getErrHtml();
	}
}
///删除合同

if (cmd.trim().equals("delete") && strErr.trim().equals("")) {


		if(!just_user.getId().trim().equals(contract.getCreateman())){
	strErr="您没有删除别人合同的权限";
	}
	if(strErr.trim().equals("")){
	contract.setConid(Integer.parseInt(conid));
	contract.delete();
	if (contract.hasErr()) strErr = contract.getErrHtml();
	}
}
	
	
if (cmd.trim().equals("") && strErr.trim().equals("")) {
 serviceid        = contract.getServiceid();
 area             = contract.getArea();
 customer         = contract.getCustomer();
 linkman          = contract.getLinkman();
 phone            = contract.getPhone();
 saleid           = contract.getSaleid();
 salesname        = contract.getSaleid();
 status           = contract.getStatus();
 begindate        = contract.getBegindate().toString();
 enddate          = contract.getEnddate().toString();
 servicelevel     = contract.getServicelevel();
 contractdesc     = contract.getContractdesc();
 contractfile     = contract.getContractlile();
 fifee       	  =FormatNum.formatNumber(contract.getFifee());
 mfee   		  = FormatNum.formatNumber(contract.getMfee());
 myear    		  = Integer.toString(contract.getMyear());
 spartfee  		  = FormatNum.formatNumber(contract.getSpartfee());
 outefee          = FormatNum.formatNumber(contract.getOutefee());
  signfee         =FormatNum.formatNumber(contract.getSignfee());
 techbegindate    = contract.getTechbegindate()+"";
 techenddate      = contract.getTechenddate()+"";
 sevbegindate     = contract.getSevbegindate()+"";
 sevenddate       = contract.getSevenddate()+"";
  analyreport     = contract.getAnalyreport();
 techsupport      = contract.getTechsupport();
  comid           = contract.getComid();
 techmanager      = contract.getTechmanager();
 assigntime       = contract.getAssigntime()+"";
 prjname		=contract.getPrjname();
saleid=contract.getSaleid();
create_man=contract.getCreateman_name();
}
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <base href="<%=basePath%>">
    
<title>My JSP 'techcontract_add.jsp' starting page</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <link href="style/main.css" rel="stylesheet" type="text/css">
	<script language="javascript" src="js/common.js"></script>

   <script language="javascript" >
function clk_goback() {
	location.href="outcon_list.jsp?mgh="+operatorForm.pageno.value;
}
   function clk_submit() {
	var oForm = document.operatorForm;
	oForm.cmd.value = "modify";
	oForm.submit();
}
function clk_delete_submit() {
	if (!confirm("确定要删除此信息吗？"))
		return;
	var oForm = document.operatorForm;
	oForm.cmd.value = "delete";
	oForm.submit();
}


function upload_contract() {
	var oForm = document.operatorForm;
	var ret = window.showModalDialog('../selectFrm.htm','incontract_mgt/upload_contract.jsp','dialogHeight: 200px;dialogWidth: 300px; center: yes; status:no;help: no');
	if(ret && ret != "") {
		oForm.contractfile.value = ret;
	}
}

//上传合同分析报告
function upload_analyreport() {
	var oForm = document.operatorForm;
	var ret = window.showModalDialog('../selectFrm.htm','incontract_mgt/upload_analyreport.jsp','dialogHeight: 200px;dialogWidth: 300px; center: yes; status:no;help: no');
	if(ret && ret != "") {
		oForm.analyreport.value = ret;
	}
}
//商船技术支援单
function upload_techsupport() {
	var oForm = document.operatorForm;
	var ret = window.showModalDialog('../selectFrm.htm','incontract_mgt/upload_techsupport.jsp','dialogHeight: 200px;dialogWidth: 300px; center: yes; status:no;help: no');
	if(ret && ret != "") {
		oForm.techsupport.value = ret;
	}
}
function clk_task_view(taskid){
var oForm = document.operatorForm;
	var ret = window.showModalDialog('../selectFrm.htm','task_mgt/task_view.jsp?taskid='+taskid,'dialogHeight: 500px;dialogWidth: 800px; center: yes; status:no;help: no');



}
</script>
</head>

<body  leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td >
  	  <form name="operatorForm" method="post" >
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height="100" align="center" valign="top" style="padding-top:10px;padding-bottom:10px;">
            <table width="98%" border="0" cellpadding="1" cellspacing="1" bgcolor="#000000">
			
			 <tr>
                <td height="24" colspan="7" bgcolor="#EDEDF0" style="padding-left:10px;">
                提示：<font color="red">*</font> 号为必填项，请您认真填写                </td>
              </tr>
               <%if (!strErr.trim().equals("")) {%>
              <tr> 
                <td height="24" colspan="7" bgcolor="#D7D7DB" style="padding-left:10px;">
                  错误提示：
                 
                  <font color=red><%=strErr%></font>                </td>
              </tr>
              <%}%>
              
              <tr> 
                <td height="24" colspan="7" bgcolor="#858585" style="padding-left:10px;">
                  <font color="#FFFFFF"><strong>用户信息</strong></font>  </td>
              </tr>
               
             <tr> 
                <td width="22%" height="24" align="right" bgcolor="#D7D7DB" >所在区域<span style="padding-right:5px;"><font color="red">*</font></span></td>
                <td width="78%" bgcolor="#EDEDF0" style="padding-left:5px;">
                   <select name="area"  style="width:100px">
                    <%for(int i=0;i<area_item_info.length;i++){%>
                    <option value="<%=area_item_info[i]%>"<%if (contract.getArea().trim().equals(area_item_info[i])){%> selected<%}%>><%=area_item_info[i]%></option>
                    <%}%>
                  </select>                  </td>
              </tr>
               <tr>
                <td height="24" align="right" bgcolor="#D7D7DB" >项目名称<span style="padding-right:5px;"><font color="red">*</font></span></td>
                <td colspan="6" bgcolor="#EDEDF0" style="padding-left:5px;">
                <input name="prjname" type="text" value="<%=prjname%>" id="prjname" class="inputBox" size="50" maxlength="100">
                </td>
              </tr>
			  
              <tr> 
                <td height="24" align="right" bgcolor="#D7D7DB" style="padding-right:5px;"> 服务合同号：</td>
                <td colspan="6" bgcolor="#EDEDF0" style="padding-left:5px;"> 
                 <input name="serviceid" type="text" size="30" maxlength="30" class="inputbox" value="<%=serviceid%>">
                 
                 </td>
              </tr>
              	 <tr>
                   <td height="24" align="right" bgcolor="#D7D7DB" style="padding-right:5px;" >登记人：</td>
                   <td bgcolor="#EDEDF0" style="padding-left:5px;" colspan="6" >
                   <input name="create_man" type="text" value="<%=create_man%>"  class="inputBox" size="30" maxlength="30" style="background-color:#EDEDE8" readonly="readonly"></td>
                 </tr>
              <tr>
                <td height="24" align="right" bgcolor="#D7D7DB" >客户名称<span style="padding-right:5px;"><font color="red">*</font></span></td>
                <td colspan="6" bgcolor="#EDEDF0" style="padding-left:5px;">
                <input name="customer" type="text" value="<%=customer%>" id="customer" class="inputBox" size="50" maxlength="100">
                </td>
              </tr>
  
                 <tr>
                   <td height="24" align="right" bgcolor="#D7D7DB" style="padding-right:5px;" >客户联系人：</td>
                   <td bgcolor="#EDEDF0" style="padding-left:5px;" colspan="6" >
                   <input name="linkman" type="text" value="<%=linkman%>" id="linkman" class="inputBox" size="30" maxlength="30"></td>
                 </tr>
                 <tr>
                   <td height="23" align="right" bgcolor="#D7D7DB" style="padding-right:5px;" >联系电话：</td>
                   <td bgcolor="#EDEDF0" style="padding-left:5px;" colspan="6" >
                   <input name="phone" type="text" id="phone" value="<%=phone%>" class="inputBox" size="30" maxlength="30"></td>
                 </tr>
               
                  <tr>
                   <td height="24" align="right" bgcolor="#D7D7DB"  >厂商<span style="padding-right:5px;"><font color="red">*</font></span></td>
                   <td bgcolor="#EDEDF0" style="padding-left:5px;" colspan="6" >
                  <select  name="comid"   style="width:100px" >
				  <option value="0">==请选择==</option>
                    <%
                  CompanyMgr comMgr = new CompanyMgr();
                    list =comMgr.getCompanys();
                    if (list != null && list.size() > 0) {
                    	for(int i=0;i<list.size();i++) {
                    		Company item = (Company)list.get(i);
                    %>
                    <option value="<%=item.getComid()%>" <%if (item.getComid()==comid) {%> selected<%}%>><%=item.getComnam()%></option>
                    <%
                    }
                    }
                    %>
                    </select>                   </td>
                 </tr>
                  <tr>
                   <td height="24" align="right" bgcolor="#D7D7DB" >项目经理<span style="padding-right:5px;"><font color="red">*</font></span></td>
                   <td bgcolor="#EDEDF0" style="padding-left:5px;" colspan="6" >
                   <select name="techmanager" style="width:100px" >
                
            	        <option value="0">==请选择==</option>
            	        <%
            	         UserMgr  userMgr = new UserMgr();
            	    String manager="pm";
            	         list = userMgr.getUsersGroupbyroleid(manager);
            	        if (list != null && list.size() > 0) {
                    		for(int i=0;i<list.size();i++){
                    			User item = (User)list.get(i);
                    	%>
                        <option value="<%=item.getId()%>"<%if (item.getId().trim().equals(techmanager.trim())) {%> selected<%}%>><%=item.getUserName()%></option>
                    	<%}}%>
            	      </select>
                   
                   </td>
                 </tr>
                
                 <tr>
                   <td height="24" align="right" bgcolor="#D7D7DB" style="padding-right:5px;" >销售员：</td>
                   <td bgcolor="#EDEDF0" style="padding-left:5px;" colspan="6"  >
                  
 
                   <select name="saleid" style="width:100px">
            	        <option value="0">==请选择==</option>
            	        <%
            	   
            	    String saler="saler";
            	        List userList = userMgr.getUsersGroupbyroleid(saler);
            	        if (userList != null && userList.size() > 0) {
                    		for(int i=0;i<userList.size();i++){
                    			User item = (User)userList.get(i);
                    	%>
                        <option value="<%=item.getId()%>"<%if (item.getId().trim().equals(contract.getSaleid().trim())) {%> selected<%}%>><%=item.getUserName()%></option>
                    	<%}}%>
            	      </select>
					</td>
                 </tr>
                
                    <tr>
                    <td height="24" align="right" bgcolor="#D7D7DB" style="padding-right:5px;" >合同状态：</td>
                    <td bgcolor="#EDEDF0" style="padding-left:5px;" colspan="6" >
                    <select name="status" style="width:100px">
                        <option value="1" <%if (status==1){%> selected<%}%>>登记</option>
                      <option value="2" <%if (status==2){%> selected<%}%>>执行</option>
                    
                    </select>                    </td>
                  </tr>
                  <tr> 
                <td height="24" align="right" bgcolor="#D7D7DB" style="padding-right:5px;" >合同有效期：</td>
                <td bgcolor="#EDEDF0" style="padding-left:5px;" colspan="6" >
                
                  从 <span id="htmlbegindateTime">&nbsp;</span> &nbsp; 至 &nbsp; <span id="htmlenddateTime" >&nbsp;</span>
                        </td>
              </tr>
             
              
			  <tr>
			    <td height="24" align="right" bgcolor="#D7D7DB" style="padding-right:5px;">合同服务等级：</td>
			    <td bgcolor="#EDEDF0" style="padding-left:5px;" colspan="6">
			    
			     <select name="servicelevel" style="width:100px">
			       <%
            	SevgradeMgr sevgradeMgr = new SevgradeMgr();
            	         list = sevgradeMgr.getGradeGroupBy();
            	        if (list != null && list.size() > 0) {
                    		for(int i=0;i<list.size();i++){
                    			Sevgrade item = (Sevgrade)list.get(i);
                    	%>
                        <option value="<%=item.getSgid()%>"<%if (item.getSgid()==servicelevel) {%> selected<%}%>><%=item.getSgname()%></option>
                    	<%}}%>
			      </select>				    </td>
			    </tr>
			  <tr>
			    <td height="24" align="right" bgcolor="#D7D7DB" style="padding-right:5px;">合同描述：</td>
			    <td bgcolor="#EDEDF0" style="padding-left:5px;" colspan="6">
			    <textarea name="contractdesc" cols="50" rows="4" id="contractdesc"><%=contractdesc%></textarea></td>
			    </tr>
			  <tr>
                   <td height="24" align="right" bgcolor="#D7D7DB" style="padding-right:5px;" >合同分析报告：</td>
                   <td bgcolor="#EDEDF0" style="padding-left:5px;" colspan="6" >
                   <input name="analyreport" type="text" value="<%=analyreport%>"  size="45" maxlength="100" readonly="readonly" style="background-color:#EDEDE8">
                  <input type="button" name="upload" onClick="upload_analyreport();" value="上传附件" class="inputButton">
                   </td>
                 </tr>
                   <tr>
                   <td height="24" align="right" bgcolor="#D7D7DB" style="padding-right:5px;" >技术支援单：</td>
                   <td bgcolor="#EDEDF0" style="padding-left:5px;" colspan="6" >
                   <input name="techsupport" type="text" value="<%=techsupport%>"   style="background-color:#EDEDE8"  size="45" maxlength="100" readonly="readonly" style="background-color:#EDEDE8">
                   <input type="button" name="upload" onClick="upload_techsupport();" value="上传附件" class="inputButton">
                   </td>
                 </tr>
                <tr> 
                <td height="24" align="right" bgcolor="#D7D7DB" style="padding-right:5px;">合同附件文件：</td>
                <td colspan="6" bgcolor="#EDEDF0" style="padding-left:5px;">
                  <input name="contractfile" type="text" id="contractlile" value="<%=contractfile%>" style="background-color:#EDEDE8"  size="45" maxlength="100" readonly="readonly"> 
                   <input type="button" name="clk_upload" onClick="upload_contract();" value="上传附件" class="inputButton"></td>
              </tr>
          
               
             
                <tr> 
                <td height="24" colspan="7" bgcolor="#858585" style="padding-left:10px;">
                  <font color="#FFFFFF"><strong>合同费用</strong></font>&nbsp;&nbsp;                   </td>
              </tr>
			    <tr>
                   <td height="24" align="right" bgcolor="#D7D7DB" style="padding-right:5px;" >初次安装费：</td>
                   <td bgcolor="#EDEDF0" style="padding-left:5px;" colspan="6" >
                   <input name="fifee" type="text" value="<%=fifee%>"   size="20"  maxlength="10" class="inputBox" style="background-color:#EDEDE8" readonly="readonly">￥</td>
                </tr>
			    <tr>
			      <td height="24" align="right" bgcolor="#D7D7DB" style="padding-right:5px;" >(1-3年)现场维护：</td>
			      <td bgcolor="#EDEDF0" style="padding-left:5px;" colspan="6" >
			      <input name="mfee" type="text" value="<%=mfee%>" size="20" maxlength="10" class="inputBox" style="background-color:#EDEDE8" readonly="readonly">￥</td>
		        </tr>
			    <tr>
			      <td height="24" align="right" bgcolor="#D7D7DB" style="padding-right:5px;" >现场维护年限：</td>
			      <td bgcolor="#EDEDF0" style="padding-left:5px;" colspan="6" >
			      <input name="myear" type="text" value="<%=myear%>" size="20" maxlength="2" class="inputBox" style="background-color:#EDEDE8" readonly="readonly">年</td>
		        </tr>
		         <tr>
			      <td height="24" align="right" bgcolor="#D7D7DB" style="padding-right:5px;" >签约金额：</td>
			      <td bgcolor="#EDEDF0" style="padding-left:5px;" colspan="6" >
			      <input name="signfee" type="text"  value="<%=signfee%>" class="inputBox" size="20" maxlength="10">￥</td>
		        </tr>
			    <tr>
			      <td height="24" align="right" bgcolor="#D7D7DB" style="padding-right:5px;" >备件成本：</td>
			      <td bgcolor="#EDEDF0" style="padding-left:5px;" colspan="6" >
			      <input name="spartfee" type="text" id="spartfee" value="<%=spartfee%>"class="inputBox" size="20" maxlength="10" >￥</td>
		        </tr>
			    <tr>
			      <td height="24" align="right" bgcolor="#D7D7DB" style="padding-right:5px;" >外部人员技术成本：</td>
			      <td bgcolor="#EDEDF0" style="padding-left:5px;" colspan="6" >
			      <input name="outefee" type="text" id="outefee" value="<%=outefee%>" class="inputBox" size="20" maxlength="10" >￥</td>
		        </tr>
		          <tr> 
                <td height="24" colspan="7" bgcolor="#858585" style="padding-left:10px;">
                  <font color="#FFFFFF"><strong>培训及服务时间</strong></font>&nbsp;&nbsp;                   </td>
                  
              </tr>
                <tr>
                  <td height="24" align="right" bgcolor="#D7D7DB" style="padding-right:5px;"><p>培训时间：</p>				 </td>
                  <td bgcolor="#EDEDF0" style="padding-left:5px;" colspan="6">
				      从 <span id="htmltechbegindateTime">&nbsp;</span> &nbsp; 至 &nbsp; <span id="htmltechenddateTime" >&nbsp;</span>
				
				  
				  &nbsp;</td>
                </tr>
                <tr>
                  <td height="24" align="right" bgcolor="#D7D7DB" style="padding-right:5px;">专业化服务时间：</td>
                  <td bgcolor="#EDEDF0" style="padding-left:5px;" colspan="6">
				   从 <span id="htmlsevbegindateTime">&nbsp;</span> &nbsp; 至 &nbsp; <span id="htmlsevenddateTime" >&nbsp;</span>
				 
				  
				  &nbsp;</td>
                </tr>
               <tr> 
                <td height="24" colspan="7" bgcolor="#858585" style="padding-left:10px;">
                  <font color="#FFFFFF"><strong>工程师信息</strong></font> &nbsp;&nbsp;
                
                </td>
              </tr>
               <tr align="center" valign="top" bgcolor="#EDEDF0"> 
                <td height="20" colspan="7" id="htmlDeviceInfo"> 
                
                  <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#EDEDF0" id="tbDeviceDetail">
                    <tr align="center" bgcolor="#D7D7DB"> 
                     <td width="18%" height="23" bgcolor="#D7D7DB"> 工程师姓名</td>
                      <td width="13%">工程师E-mail</td>
                      <td width="22%">工程师电话</td>
                      <td width="9%">工单状态</td>
                         <td width="9%">详情</td>
                    </tr>
                <%
                    list = contract.getListEngs();
                    if (list != null && list.size() > 0) {
                    	for(int i=0;i<list.size();i++) {
                    		Techconeng techEng = (Techconeng)list.get(i);
                    		
                    %>
                    <tr align="center" bgcolor="#FFFFFF">
                      <td height="24"><%=techEng.getEng_name()%></td>
                      <td><%=techEng.getUser().getEmail()%></td>
                      <td><%=techEng.getUser().getPhone()%></td>
                      <td> <%=techEng.getTaskStatus_name()%> </td>
                    	 <td>
                       <% if(techEng.getTaskid()!=0){%>
                        <span onclick="clk_task_view('<%=techEng.getTaskid()%>');"
							style="cursor:hand;text-decoration: underline;">查看</span>
							<%}%>
							</td>
           		 </tr>
                    <%}}%>
                  </table>
                </td>
              </tr>
              <tr> 
                <td bgcolor="#EDEDF0" colspan="7" align="center">
                     <input type="button" onclick="clk_submit()" name="btn2" value="保 存" class="inputButton">
				<input type="button" onclick="return clk_delete_submit();" name="btn" value="删 除" class="inputButton">
				<input type="button" name="button1" value="返 回" class="inputButton" onclick="clk_goback();"> 
                    <input type="hidden" name="cmd" value="">     
                    <input type="hidden" name="pageno" value="<%=pageno%>"> 
                           </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
      </form>
    </td>
  </tr>
</table>
<script language="javascript">

htmltechbegindateTime.innerHTML = showCalenderInput("techbegindate","operatorForm","<%=techbegindate%>",1);
htmltechenddateTime.innerHTML = showCalenderInput("techenddate","operatorForm","<%=techenddate%>",1);

htmlbegindateTime.innerHTML = showCalenderInput("begindate","operatorForm","<%=begindate%>",1);
htmlenddateTime.innerHTML = showCalenderInput("enddate","operatorForm","<%=enddate%>",1);

htmlsevbegindateTime.innerHTML = showCalenderInput("sevbegindate","operatorForm","<%=sevbegindate%>",1);
htmlsevenddateTime.innerHTML = showCalenderInput("sevenddate","operatorForm","<%=sevenddate%>",1);
</script>
<%if (cmd.equals("modify") && strErr.trim().equals("")){%>
<script language="javascript">
alert("记录信息修改成功!");
location.href="outcon_list.jsp?mgh="+operatorForm.pageno.value;
</script>
<%}%>

<%if (cmd.equals("delete") && strErr.trim().equals("")){%>
<script language="javascript">
alert("记录信息删除成功!");
location.href="outcon_list.jsp?mgh="+operatorForm.pageno.value;
</script>
<%}%>
<iframe id="ifrmActiveArea" name="ifrmActiveArea" frameborder="0" width="1" height="1" scrolling="no"></iframe>

</body>
</html>
